﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace PushTestForm
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        PushMessage GetNowMessage()
        {
            return new PushMessage() { Title = DateTime.Now.ToLongDateString(), Desc = DateTime.Now.ToLongTimeString(), Key = DateTime.Now.ToLongTimeString() };
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            while (true)
            {
                //广播（不包括组播）推送频率有限制：1分钟内最多推送一条
                PushHelper.PushAllNotification(DeviceType.Andriod, GetNowMessage());
                //PushHelper.PushNotification(PushHelper.UserList, GetNowMessage());
                System.Threading.Thread.Sleep(60 * 1000);
            }
        }
    }
}
